package com.departmentstore.repository;

import com.departmentstore.entity.ManufacturerProduct;
import com.departmentstore.entity.ManufacturerProductId;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ManufacturerProductRepository extends JpaRepository<ManufacturerProduct, ManufacturerProductId> {
    // 根据制造商ID查找关联
    List<ManufacturerProduct> findByManufacturer(String manufacturerId);
    
    // 根据产品ID查找关联
    List<ManufacturerProduct> findByProduct(String productId);
    
    // 根据制造商ID和产品ID查找关联
    ManufacturerProduct findByManufacturerAndProduct(String manufacturerId, String productId);
} 